package com.xiaocz.hblsubstitutedriving.activities.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import com.xiaocz.hblsubstitutedriving.R;
import com.xiaocz.hblsubstitutedriving.base.BaseActivity;

import butterknife.BindView;


/**
 * Author:  xiaocz.
 * Descr:  图片展示
 */
public class ImageViewActivity extends BaseActivity {

    @BindView(R.id.title)
    TextView title;
    @BindView(R.id.image_view)
    ImageView imageView;


    public static void show(Context context, int type) {
        Intent intent = new Intent(context, ImageViewActivity.class);
        intent.putExtra("TYPE", type);
        context.startActivity(intent);
    }

    private int type;

    @Override
    protected boolean initArgs(Bundle bundle) {
        if (bundle != null) {
            type = bundle.getInt("TYPE");
        }
        return super.initArgs(bundle);
    }

    private int[] image = {R.drawable.image_gzh, R.drawable.image_gzhkh, R.drawable.image_zlhkh};
    private String[] titleValue={"公众号下单","公众号客服","直连号客服"};

    @Override
    protected void initData() {
        super.initData();
        title.setText(titleValue[type-1]);
        imageView.setImageResource(image[type - 1]);
    }

    @Override
    protected int getLayoutSourceId() {
        return R.layout.activity_image_view;
    }

}
